/*
 * (C) APUE
 * use vfork
 */
#include "apue.h"
int glob = 6;
int main()
{
	int var;
	pid_t pid;
	var = 88;
	printf("before vfork\n");

	if ((pid = vfork()) < 0)
		err_quit("vfork error");
	else if (pid == 0) /* child process */
	{
		glob++;
		var++;
	//	_exit(0);
		exit(0);
	}

	/* parant continues here */
	printf("pid = %d, glob = %d, var = %d\n", pid, glob, var);
	exit(0);
}
